{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
    <!--  要求当前页面使用IE浏览器最高版本的内核来渲染-->
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport"
          content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=0">
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="{% static 'bootstrap-3.3.7-dist/css/bootstrap.min.css' %}">
    <script src="{% static 'js/jquery.min.js' %}"></script>
</head>
<body>
{#{% for mdepartment in mdepartments %}#}
{#    <li><a onclick="d_list_click(this.id); return false" class="db_get" id="{{ mdepartment.d_name }}" >{{ mdepartment.d_name }}</a></li>#}
{#    {% ifequal mdepartment.d_name dl_is %}#}
{#        {% for dl_n in dl_ns %}#}
{#            <li>{{ dl_n.d_name }}</li>#}
{#        {% endfor %}#}
{#    {% endifequal %}#}
{#{% endfor %}#}
<button>获取所有图书</button>
<script>
    $('button').click(function () {
        $.ajax({
            type: 'post',
            url: '{% url 'get_all' %}',
            data: JSON.stringify({a: 1}),
            dataType: 'application/json',
            contentType: 'json',
            success: function (resp) {
                console.log(resp, typeof resp);

            },

        })
    })
    {#function d_list_click (ad) {#}
    {#d_l_name = ad;#}
    {#// alert(d_l_name);#}
    {#$.ajax({#}
    {#        type: 'post',#}
    {#        url: '../../basedata/department_list/',#}
    {#        data: JSON.stringify({'d_l_name':d_l_name,}),#}
    {#        dataType: 'application/json',#}
    {#        contentType: 'json',#}
    {#        success: function(resp) {#}
    {#           console.log(resp, typeof resp);#}
    {##}
    {#        }#}
    {#    }) }#}
    {#$.post("../../basedata/department_list/",{'d_l_name':d_l_name,},#}
    {#    function (rees){#}
    {#    alert(d_l_name);#}
    {#    $("#ress").html(ret);#}
    {#    alert(ret);#}
    {#    alert(typeof(ret))#}
    {#    var data = JSON.parse(rees)#}
    {#    alert(data.status)#}
    {#    alert(data.data)#}
    {#    });#}

</script>
</body>
</html>